package com.steptime.security;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

@Component
public class MyUserDetailService implements UserDetailsService {

  private Log log = LogFactory.getLog(this.getClass());
  @Override
  public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
   log.info("登录用户信息:"+s);
    return new User("admin", "123456", AuthorityUtils.commaSeparatedStringToAuthorityList("admin"));
  }
}
